package p.ithorns.tools.translator.apt.handler;

import p.ithorns.tools.translator.apt.AbstractHandler;
import p.ithorns.tools.translator.apt.model.AnnotateMeta;
import p.ithorns.tools.translator.apt.model.AnnotatedParam;

import java.util.ArrayList;
import java.util.List;
import java.util.Set;

/**
 * TableFieldHandler
 *
 * @author HtL
 * @date 2024/6/11 9:45
 * @since 1.0.0
 */
public class TableIdHandler extends AbstractHandler {

    @Override
    public AnnotateMeta rebuild(AnnotateMeta meta) {
        // 将其变成@TableField(exist=false)
        meta.setName("TableField");
        meta.setFqn("com.baomidou.mybatisplus.annotation.TableField");
        List<AnnotatedParam> params = new ArrayList<>(1);
        params.add(new AnnotatedParam("exist", Boolean.FALSE));
        meta.setParams(params);
        return meta;
    }

    @Override
    protected Set<String> getHandleTypes() {
        return Set.of("com.baomidou.mybatisplus.annotation.TableId");
    }

}